/* 基础样式 */
:root {
    --primary-color: #4169e1;
    --secondary-color: #6495ed;
    --text-color: #333;
    --light-text: #666;
    --border-color: #d3e0f9;
    --bg-color: #f5f9ff;
    --card-bg: rgba(255, 255, 255, 0.95);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* 导航栏样式 */
.forum-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

.navbar-search {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 20px;
    padding: 5px 15px;
}

.navbar-search input {
    border: none;
    outline: none;
    padding: 5px;
    width: 200px;
}

.navbar-search button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--light-text);
}

.navbar-user {
    display: flex;
    align-items: center;
}

/* 主要内容区布局 */
.main-content {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* 左侧边栏样式 */
.sidebar {
    width: 250px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
}

.sidebar-header {
    padding: 0 20px 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.sidebar-header h4 {
    font-size: 1.1rem;
    color: var(--primary-color);
}

.nav-list {
    list-style: none;
    padding: 0 15px;
}

.nav-link {
    display: block;
    padding: 10px 15px;
    margin-bottom: 5px;
    border-radius: 5px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(100, 149, 237, 0.1);
    color: var(--primary-color);
}

/* 中间内容区样式 */
.content-area {
    flex: 1;
    padding: 20px;
    background-color: white;
}

.content-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.content-header h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.content-tabs {
    display: flex;
    gap: 10px;
}

.tab-btn {
    padding: 5px 15px;
    border: 1px solid var(--border-color);
    background-color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tab-btn:hover {
    background-color: var(--bg-color);
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.post-item {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.post-item:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 6px rgba(100, 149, 237, 0.1);
}

.post-title {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.post-meta {
    font-size: 0.8rem;
    color: var(--light-text);
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
}

.post-content-preview {
    color: var(--light-text);
    font-size: 0.95rem;
    line-height: 1.5;
}

.post-stats {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--light-text);
}

.content-footer {
    text-align: center;
    margin-top: 20px;
}

.load-more-btn {
    padding: 8px 25px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.load-more-btn:hover {
    background-color: rgba(100, 149, 237, 0.1);
}

/* 右侧边栏样式 */
.right-sidebar {
    width: 300px;
    padding: 20px;
    background-color: var(--card-bg);
    border-left: 1px solid var(--border-color);
}

.user-card, .hot-posts-card, .announcement-card {
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.card-header {
    padding: 10px 15px;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.card-header h5 {
    font-size: 1rem;
    margin: 0;
}

.card-body {
    padding: 15px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 3px solid var(--bg-color);
}

.user-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.user-email {
    font-size: 0.8rem;
    color: var(--light-text);
    margin-bottom: 10px;
}

.user-stats {
    display: flex;
    width: 100%;
    justify-content: space-around;
    margin-bottom: 15px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-weight: bold;
    font-size: 1.1rem;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--light-text);
}

.user-actions {
    width: 100%;
}

.user-btn {
    width: 100%;
    padding: 8px;
    margin-bottom: 5px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-profile {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.btn-profile:hover {
    background-color: rgba(100, 149, 237, 0.1);
}

.btn-logout {
    background-color: #f8d7da;
    color: #721c24;
}

.btn-logout:hover {
    background-color: #f5c6cb;
}

.hot-post-list {
    list-style: none;
}

.hot-post-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.hot-post-item:last-child {
    border-bottom: none;
}

.hot-post-title {
    font-size: 0.9rem;
    color: var(--text-color);
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
}

.hot-post-title:hover {
    color: var(--primary-color);
}

.hot-post-meta {
    font-size: 0.7rem;
    color: var(--light-text);
    display: flex;
    justify-content: space-between;
}

.announcement-content p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .sidebar {
        display: none;
    }

    .content-area {
        border-right: none;
    }
}

@media (max-width: 768px) {
    .right-sidebar {
        display: none;
    }

    .navbar-search input {
        width: 150px;
    }
}
     /* 顶部用户操作区基础样式 */
 #userActions {
     margin-left: auto;
     padding-right: 20px;
 }

/* 用户下拉菜单容器 */
.user-dropdown {
    position: relative;
    display: inline-block;
}

/* 用户名显示样式 */
.dropdown-toggle {
    display: flex;
    align-items: center;
    color: #333;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.dropdown-toggle:hover {
    background-color: #f5f5f5;
    color: #1890ff;
}

.dropdown-toggle span {
    margin-right: 5px;
}

/* 下拉菜单样式 */
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 160px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 5px 0;
    z-index: 1000;
    display: none;
    animation: fadeIn 0.2s ease-out;
}

/* 下拉菜单项样式 */
.dropdown-item {
    display: block;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
    color: #1890ff;
}

/* 分割线样式 */
.dropdown-divider {
    height: 1px;
    margin: 5px 0;
    background-color: #e8e8e8;
}

/* 鼠标悬停显示下拉菜单 */
.user-dropdown:hover .dropdown-menu {
    display: block;
}

/* 退出登录按钮特殊样式 */
#logoutBtn {
    color: #f5222d;
}

#logoutBtn:hover {
    background-color: #fff1f0;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .dropdown-menu {
        position: fixed;
        top: auto;
        right: 10px;
        bottom: 60px;
        min-width: 200px;
    }
}
